package com.wardrobe.dao.train_manage;

import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.domain.train_manage.TrainManageBean;
import com.wardrobe.domain.train_manage.TrainManageShowBean;
import com.wardrobe.mapper.master.train_manage.TrainManageMasterMapper;
import com.wardrobe.mapper.slave.train_manage.TrainManageSlaveMapper;
import com.wardrobe.soa.backend.train_manage.BackTrainManageBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/15.
 */
@Service
public class TrainManageDao {
    @Autowired
    private TrainManageMasterMapper trainManageMasterMapper;
    @Autowired
    private TrainManageSlaveMapper trainManageSlaveMapper;

    public List<TrainManageShowBean> selectTrainManage(BackTrainManageBean manageBean){
        return trainManageSlaveMapper.selectTrainManage(manageBean);
    }

    public TrainManageShowBean selectTrainManageById(int id){
        return trainManageSlaveMapper.selectTrainManageById(id);
    }

    public int insertTrainManage(TrainManageBean trainManageBean){
        return trainManageMasterMapper.insertTrainManage(trainManageBean);
    }

    public int updateTrainMange(BackEndFromBean fromBean){
        return trainManageMasterMapper.updateTrainMange(fromBean);
    }

    public long countTrainManage(BackTrainManageBean manageBean){
        return trainManageSlaveMapper.countTrainManage(manageBean);
    }

    public int deleteTrainManage(int id){
        return trainManageMasterMapper.deleteTrainManage(id);
    }

    public List<TrainManageShowBean> selectTrainManageList(){
        return trainManageSlaveMapper.selectTrainManageList();
    }
}
